<?
	require_once('../inc/facebook.php');
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Home Page</title>
    <link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css">
    <link rel="stylesheet" type="text/css" href="../inc/bootstrap.css">
    <style type="text/css" >
    	li {
    		margin: 5px;
			height: 55px;
    	}
		li img{
			float: left;
		}
 	</style>
</head>

<body>
        <? include('../inc/header.php'); ?>
        <div class="container">
			<? include('../inc/nav.php'); ?>
            <div id="contents">
            	
            
            </div>
       </div>
       
    <script id="list_template" type="text/x-handlebars-template">
    	<h3>Searched for {{query}}</h3>
	  	<ul class="unstyled">
	  		{{#each results}}
	  			{{> t_item}}
	  		{{/each}}	  	
	  	</ul>
	</script>
	<script id="item_template" type="text/x-handlebars-template">
	  <li id="list_item_{{id}}">
	  	<img src="{{profile_image_url}}" />
	  	{{from_user_name}}
	  	(@{{from_user}})
	    {{text}}
		{{{source}}}
	  </li>
	</script>
	<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.rc.1/handlebars.min.js">
	</script>
	<script type="text/javascript">
		$(function(){
			var userUrl = "http://twitter.com/status/user_timeline/";	// append "USERNAME.json?callback=?" to end
			var searchUrl = "http://search.twitter.com/search.json"
			var t_list = Handlebars.compile($("#list_template").html());
			var t_item = Handlebars.compile($("#item_template").html());
			Handlebars.registerPartial('t_item', t_item);

			$.getJSON(searchUrl + "?callback=?", {q : "#NewPaltz"}, function(data){
						$("#contents").append(t_list(data));
			});
			
		})
	</script>
       
</body>
</html>


